
import SwiftUI

struct ControlPanelView: View {
    @EnvironmentObject var appState: AppState

    var body: some View {
        VStack(alignment: .leading, spacing: 15) {
            Text("控制面板")
                .font(.headline)

            Button {
                appState.goBack()
            } label: {
                Label("上一步", systemImage: "arrow.backward")
                    .frame(maxWidth: .infinity) // 让标签充满按钮宽度
            }
            .buttonStyle(.bordered) // 使用边框样式

            Button {
                appState.goToMainMenu()
            } label: {
                 Label("主菜单", systemImage: "house")
                    .frame(maxWidth: .infinity)
            }
            .buttonStyle(.bordered)

            Button {
                appState.resetModelTransform()
            } label: {
                 Label("重置模型", systemImage: "arrow.counterclockwise")
                    .frame(maxWidth: .infinity)
            }
            .buttonStyle(.bordered)
        }
        .padding(20)
        // 使用 .glassBackgroundEffect() 在 RealityView 的 attachments 中添加
    }
}
